home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 1120 < prev    next >
Encoding:
Text File  |  1996-08-06  |  752 b   |  43 lines

  1. Path: news.kth.se!news
  2. From: Anders Olsson <aolsson@struct.kth.se>
  3. Newsgroups: comp.lang.c++
  4. Subject: OO design issue
  5. Date: 9 Jan 1996 12:47:49 GMT
  6. Message-ID: <4cto5l$2gu@news.kth.se>
  7. NNTP-Posting-Host: lotus.ce.kth.se
  8. Mime-Version: 1.0
  9. Content-Type: text/plain; charset=iso-8859-1
  10. Content-Transfer-Encoding: 8bit
  11.  
  12.  
  13. I have some questions about how to design relations between a class and
  14. its member classes.
  15.  
  16. I can simplify my problem to the following two classes:
  17.  
  18. class Node
  19. {
  20. public:
  21.    double GetXCoordinate();
  22. private:
  23.  
  24. };
  25.  
  26. class Triangle
  27. {
  28. public:
  29.    double CalculateArea();
  30. private:
  31.    int nNodeIndex[3]; // Index into node vector
  32. };
  33.  
  34. class TrianglesAndNodes
  35. {
  36. private:
  37.    vector<Node>    NodeVector;   
  38.    vector<Element> ElementVector;
  39. };
  40.  
  41.  
  42.  
  43.